package org.rowan.adi.tda.tda2d;

import java.util.LinkedList;
import org.rowan.adi.components.comp2d.polygon.Polygon;
import org.rowan.adi.tda.tda2d.services.Optimization2D;

/**
 * The OptimizationTDA2D class is a two dimensional tactical decision aid. It
 * provides the ability to run at least one service on its low-level components,
 * which in this case is the Optimization2D service.
 *
 * @author Robert Russell
 * @version 1.0
 */
public class OptimizationTDA2D extends DecisionManager2D {

    /**
     * Constructs an instance of OptimizationTDA2D.
     * @param highLevelComponent the high level 2D component within the OptimizationTDA2D.
     * @param lowLevelComponents the low-level 2D components within the OptimizationTDA2D.
     * @param bestCase <code>true</code> if the best-case solution is desired; otherwise
     * <code>false</code> meaning the worst-case solution is desired.
     */
    public OptimizationTDA2D(Polygon highLevelComponent, LinkedList<Polygon> lowLevelComponents, boolean bestCase) {
        super.highLevelComponent = highLevelComponent;
        super.lowLevelComponents = lowLevelComponents;
        super.addService(new Optimization2D(super.highLevelComponent, super.lowLevelComponents, bestCase));
    }
}
